home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 5278 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: howland.reston.ans.net!gatech!gt-news!james
  2. From: james@amber.biology.gatech.edu (James McIninch)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Limit on #bytes inside of struct?
  5. Date: 9 Feb 1996 15:17:14 GMT
  6. Organization: Georgia Institute of Technology
  7. Distribution: world
  8. Message-ID: <4ffohq$1gb@mordred.gatech.edu>
  9. References: <4feg1d$d4g@cville-srv.wam.umd.edu> <4ffg6b$ivd@sparcserver.lrz-muenchen.de>
  10. NNTP-Posting-Host: exon.biology.gatech.edu
  11. X-Newsreader: TIN [version 1.2 PL2]
  12.  
  13. ua302aa@lrz-muenchen.de wrote:
  14. : jsquires@wam.umd.edu (jeffrey d squires) writes:
  15.  
  16. : >I have the following:
  17.  
  18. : >typedef struct {
  19. : >        int zero;
  20. : >        int one;
  21. : >        int two;
  22. : >        int three;
  23. : >        int four;
  24. : >        int five;
  25. : >        int six;
  26. : >        int seven_or_more;
  27. : >} hist_type;
  28.  
  29. : >hist_type histogram;
  30. : >int num=2;
  31.  
  32. : >histogram.four = 0;  /* at this point, value of num changes from 2 to 0!!!*/
  33.  
  34. : >Is there a limit on the number of bytes allowed inside of a struct?
  35.  
  36. : Yes, there is a limit on the number of bytes allowed in one 
  37. : object. That limit is 32k. 
  38.  
  39. No. There is no limit. Individual implementations of compilers or OS's may
  40. impose a limit, but there is no limit that is integral to the C languag itself.
  41.  
  42.  
  43. : >I am positive that the value of num changes from 2 before the last 
  44. : >assignment to 0 after it.  Any ideas? 
  45.  
  46. How do you know this? The code above doesn't even print anything out?
  47.  
  48.  
  49. : Not really :-(. It you can post a minimal example that demonstrates
  50. : this error, it might be possible to find the problem.
  51.  
  52. What he said.
  53.  
  54.  
  55. : >Is this a bug in gcc?
  56. : Very improbable!
  57.  
  58. Likewise.
  59.